#include "globalarray.h"
#include <stdio.h>
#include <stdlib.h>

int main(int argc,char **argv)
{

        
	char type[6]="double";
	char name[8]="array1\0";
	int size[1] = {8};
        int index[1];
	int dim = 1;
        double value;

        uo_init(argc, argv);
        /* Test 1D array operation */
        printf("Test case 1: 1D array operation\n"); 

        /* Create an array on gloabl address space */ 
        printf("\t1.1 uo_new_array(): %s[%d]\n",name,size[0]);
	uo_new_array(name, type,size, dim);
        
        /* Populate matrix element */  
	printf("\t1.2 uo_put_element():\n");
        index[0] = 0;
        value = 1;
        uo_put_element(name, index, &value);
        
	/* Get a element */
        printf("\t1.3 uo_get_element():\n");

               
        /* Clean up MPI and free memory */
        printf("\tFree array\n");
        uo_free_array(name);
        
	return 0;
}

